package pattern.adapter;

/**
 * Created by boot on 9/1/15.
 */
public class NoteBook {
    private ThreePlug plug;

    public NoteBook(ThreePlug tp) {
        this.plug = tp;
    }

    public ThreePlug getPlug() {
        return plug;
    }


    public void setPlug(ThreePlug plug) {
        this.plug = plug;
    }


    public void charge() {
        plug.power();
    }

    public static void main(String[] arg) {

        GBTowPlug gb = new GBTowPlug();
        ThreePlug tp = new TowPlugAdapter(gb);
        NoteBook nb = new NoteBook(tp);
        nb.charge();
    }
}
